package 数据结构.链表;

import org.junit.Test;

/**
 * @author Veng Su 1344114844@qq.com
 * @date 2018/7/18 17:13
 */
public class Main {
    @Test
    public void test(){
        LinkedList<String> linkedList=new LinkedList<>();
        for (int i = 0; i < 10; i++) {
            linkedList.addFirst(String.format("第%d个结点",i));
        }
        linkedList.add(2,"asdfasf");
        linkedList.set(3,"hello");
        System.out.println(linkedList.toString());
        System.out.println(linkedList.getFirst());
        linkedList.remove(2);
        linkedList.removeFirst();
        System.out.println(linkedList);
    }
}
